<include file="../Public/_header.html" />
<div class="so_main">
<php>
	//dump($pagedata);
</php>
  
  	<!-------- 搜索开始 -------->
		  <div id="search_div" rel='0'>
		  	<div class="page_tit">
		  		搜索[ <a href="javascript:void(0);" onclick="_show_searcharea();">隐藏</a> ]
		  	</div>
				
				<div class="sform">
					<form method="post" action="{:U('/Advisory/index')}" id="searchForm">
						<input id="pno" name="pno" type="hidden" value="1">
						<input id="sortcode" name="sortcode" type="hidden" value="{$sortcode}">
						<dl>
							<span>选择类型：</span>
					      	<input name="ownertype" type="radio" value="all" <eq name="ownertype" value="all">checked</eq>>全部
					        <input name="ownertype" type="radio" value="user" <eq name="ownertype" value="user">checked</eq>>用户
					        <input name="ownertype" type="radio" value="shanghu" <eq name="ownertype" value="shanghu">checked</eq>>商户
							<span>是否解决：</span>
					      	<input name="hadanswered" type="radio" value="all" <eq name="hadanswered" value="all">checked</eq>>全部
					        <input name="hadanswered" type="radio" value="Y" <eq name="hadanswered" value="Y">checked</eq>>是
					        <input name="hadanswered" type="radio" value="N" <eq name="hadanswered" value="N">checked</eq>>否
					    </dl>	
					    <dl>
					    	<input type="submit" class="btn_b" value="搜索" />
					    	&nbsp;&nbsp;&nbsp;&nbsp;
					    	<input type="reset" class="btn_b" value="清空" />
					    </dl>
					</form>
					<div class="clear"></div>
			  </div>
		  </div>
		  <!-------- 搜索结束 -------->
		  
  <div class="page_tit">咨询管理</div>
  <div class="Toolbar_inbox">
  		<a href="javascript:void(0);" class="btn_a" onclick="_show_searcharea();">
			<span>条件搜索</span>
		</a>
		<a href="javascript:void(0);" class="btn_a" onclick="del();"><span>删除商户</span></a>
  </div>
  
  <div class="list">
  <table id="partner_list" width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
  	<th style="width:30px;">
        <input type="checkbox" id="checkbox_handle" onclick="table_checkAll(this)" value="0">
        <label for="checkbox"></label>
    </th>
    <th class="line_l">ID</th>
    <th class="line_l">提问者</th>
    <th class="line_l">问题</th>
    <th class="line_l">答案</th>
    <th class="line_l" style="text-align:center">操作</th>
  </tr>
  <volist id="vo" name="pagedata['data']">
  
      <tr overstyle='on' id="{$vo.id}">
      	<td><input type="checkbox" name="checkbox" id="checkbox2" onclick="table_checkon(this)" value="{$vo.id}"></td>
        <td>{$vo.id}</td>
        <td>
        	<php>if($vo['ownertype']=="user"){ $img_url =getUserFace($vo['ownerid'],'s');}</php>
        	<php>if($vo['ownertype']=="shanghu"){ $img_url = getAttachUrl(getParnterIconById($vo['ownerid'])) ;}</php>
        	
        	<img src="{$img_url}" width="30">
        </td>
        <td>{$vo['question_text']}</td>
        <td>{$vo['answer_text']}</td>
        <td style="text-align:center">
            <a href="javascript:k_show('{:U('/Advisory/answer',array('advid'=>$vo['id']))}',null,'回复')" >回复</a>&nbsp; 
            <a href="javascript:del('$vo['id']')" >删除</a>   
        </td>
      </tr>
  </volist>
  </table>

  </div>
  <div class="Toolbar_inbox">
    <div class="page_box">{$pagedata['html']}</div>
  </div>
</div>

<script>
	
    //鼠标移动表格效果
    $(document).ready(function(){
    	table_init();
    });
    
    
   
    
    //删除分类
    function del(aid) {
        aid = aid ? aid : table_getChecked();
        aid = aid.toString();
        if(aid == '') return false;
				if(!confirm('确定删除么？')){
						return;
				}
        //提交删除
        $.post("{:U('/Advisory/doDelete')}", {ids:aid}, function(res){
	        if(res == '1') {
		        aid = aid.split(',');
		        $.each(aid, function(i,n){
		            $('#'+n).remove();
		        });
	            ui.success('删除成功');
	        }else {
	        	ui.success('删除失败');
	        }
        });
    }
</script>

<include file="../Public/_footer.html" />